home *** CD-ROM | disk | FTP | other *** search
- #include <CITGroup.h>
- #include <CITLabel.h>
-
- #include <intuition/screens.h>
- #include <graphics/text.h>
- #include <stdlib.h>
-
- __chip UWORD image_data[] =
- {
- /* Plane 0 */
- 0x0000, 0x0000,
- 0x7F00, 0x0000,
- 0x4180, 0x0000,
- 0x4140, 0x0000,
- 0x4120, 0x4000,
- 0x41F0, 0x6000,
- 0x401B, 0xF000,
- 0x401B, 0xF800,
- 0x401B, 0xF000,
- 0x4018, 0x6000,
- 0x4018, 0x4000,
- 0x4018, 0x0000,
- 0x4018, 0x0000,
- 0x7FF8, 0x0000,
- 0x1FF8, 0x0000,
- 0x0000, 0x0000,
- /* Plane 1 */
- 0x0000, 0x0000,
- 0x0000, 0x0000,
- 0x3E00, 0x0000,
- 0x3E80, 0x0000,
- 0x3EC0, 0x0000,
- 0x3E00, 0x0000,
- 0x3FE0, 0x0000,
- 0x3FE0, 0x0000,
- 0x3FE0, 0x0000,
- 0x3FE0, 0x0000,
- 0x3FE0, 0x0000,
- 0x3FE0, 0x0000,
- 0x3FE0, 0x0000,
- 0x0000, 0x0000,
- 0x0000, 0x0000,
- 0x0000, 0x0000
- };
-
- struct Image image =
- {
- 0, 0, 22, 16, 2, image_data, 0x03, 0x00, NULL
- };
-
- UWORD map[] = {BACKGROUNDPEN,SHADOWPEN};
-
- class CITApp Application;
-
- class CITWorkbench DemoScreen;
- class CITWindow DemoWindow;
- class CITVGroup winGroup;
- class CITLabel label;
-
- void CloseEvent();
-
- int main(void)
- {
- BOOL Error=FALSE;
-
- DemoScreen.InsObject(DemoWindow,Error);
- DemoWindow.Position(30,30);
- DemoWindow.CloseGadget();
- DemoWindow.DragBar();
- DemoWindow.DepthGadget();
- DemoWindow.Activate();
- DemoWindow.SizeGadget();
- DemoWindow.IconifyGadget();
- DemoWindow.Caption("Label Demo");
- DemoWindow.CloseEventHandler(CloseEvent);
- DemoWindow.InsObject(winGroup,Error);
- winGroup.InsObject(label,Error);
- label.Justification(LABEL_CENTRE);
- label.Text("_Under-scored\nNot under-scored\n");
- label.Text("An image:");
- label.Image(&image);
- label.Mapping(map);
- label.Text("\nChange fonts,\n");
- label.FGPen(3);
- label.Font("emerald.font",18);
- label.Text("and colours,");
- label.FGPen(2);
- label.Text(" and styles");
- label.SoftStyle(FSF_BOLD);
-
- Application.InsObject(DemoScreen,Error);
-
-
- // Ok?
- if( Error )
- return 10;
-
- Application.Run();
-
- Application.RemObject(DemoScreen);
-
- return 0;
- }
-
- int repeatCount = 0;
-
- void CloseEvent()
- {
- repeatCount++;
-
- switch( repeatCount )
- {
- case 1:
- DemoWindow.Position(50,50);
- break;
- case 2:
- DemoWindow.Size(300,180);
- break;
- default:
- Application.Stop();
- break;
- }
- }
-